/*
 * @Descripttion: |
 * @version: 1.0
 * @Author: 王娆
 * @Date: 2020-09-03 20:26:13
 * @LastEditors: 王娆
 * @LastEditTime: 2020-09-03 21:05:37
 */
import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [{
        path: '/',
        redirect: '/login'
    }, {
        path: '/login',
        name: 'Login',
        component: () =>
            import ( /* webpackChunkName: "about" */ '../views/Login/index.vue'),
    }, {
        path: '/register',
        name: 'Register',
        component: () =>
            import ( /* webpackChunkName: "about" */ '../views/Register/index.vue'),
    }, {
        path: '/patient/healthRecord',
        name: 'HealthRecord',
        component: () =>
            import ( /* webpackChunkName: "about" */ '../views/HealthRecord/index.vue')
    },
    {
        path: '/homeIndex',
        name: 'Index',
        component: () =>
            import ( /* webpackChunkName: "about" */ '../views/Index.vue'),
        children: [{
            path: '/homeIndex',
            redirect: '/homeIndex/home'
        }, {
            path: '/homeIndex/home',
            name: 'Home',
            component: () =>
                import ( /* webpackChunkName: "about" */ '../views/home/Home.vue'),
        }, {
            path: '/homeIndex/shop',
            name: 'Shop',
            component: () =>
                import ( /* webpackChunkName: "about" */ '../views/shop/Shop.vue'),
        }, {
            path: '/homeIndex/record',
            name: 'Record',
            component: () =>
                import ( /* webpackChunkName: "about" */ '../views/record/Record.vue'),
        }, {
            path: '/homeIndex/personal',
            name: 'Personal',
            component: () =>
                import ( /* webpackChunkName: "about" */ '../views/personal/Personal.vue'),
        }]
    }, {
        path: '/search',
        name: 'Search',
        component: () =>
            import ( /* webpackChunkName: "about" */ '../views/Search/Search.vue'),
    }, {
        path: '/storehouse',
        name: 'Storehouse',
        component: () =>
            import ( /* webpackChunkName: "about" */ '../views/Search/Storehouse.vue'),
    }, {
        path: '/disease',
        name: 'Disease',
        component: () =>
            import ( /* webpackChunkName: "about" */ '../views/Search/Disease.vue'),
    }, {
        path: '/healthSurveyList',
        name: 'HealthSurveyList',
        component: () =>
            import ( /* webpackChunkName: "about" */ '../views/Search/HealthSurveyList.vue'),
    },
    {
        path: '/healthSurvey',
        component: () =>
            import ('@/views/healthSurvey/HealthSurvey.vue'),
        children: [{
            path: '/healthSurvey/surveyStart',
            component: () =>
                import ('@/views/healthSurvey/SurveyStart.vue')
        }, {
            path: '/healthSurvey/survey',
            component: () =>
                import ('@/views/healthSurvey/Survey.vue')
        }, {
            path: '/healthSurvey/surveyResult',
            component: () =>
                import ('@/views/healthSurvey/SurveyResult.vue')
        }]
    },
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router